Optimal. Leaf size=309 \[ \frac {((1+i) A+2 B) \text {ArcTan}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}-\frac {((1+i) A+2 B) \text {ArcTan}\left (1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}-\frac {((-1+i) A+2 B) \log \left (1-\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{32 \sqrt {2} a^3 d}+\frac {((-1+i) A+2 B) \log \left (1+\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{32 \sqrt {2} a^3 d}+\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.42, antiderivative size = 309, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 9, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3676, 3677,
3615, 1182, 1176, 631, 210, 1179, 642} \begin {gather*} \frac {(2 B+(1+i) A) \text {ArcTan}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}-\frac {(2 B+(1+i) A) \text {ArcTan}\left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{16 \sqrt {2} a^3 d}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {(2 B-(1-i) A) \log \left (\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{32 \sqrt {2} a^3 d}+\frac {(2 B-(1-i) A) \log \left (\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{32 \sqrt {2} a^3 d}+\frac {(-B+i A) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1182
Rule 3615
Rule 3676
Rule 3677
Rubi steps
\begin {align*} \int \frac {\tan ^{\frac {3}{2}}(c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^3} \, dx &=\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}-\frac {\int \frac {\sqrt {\tan (c+d x)} \left (\frac {3}{2} a (i A-B)-\frac {3}{2} a (A-3 i B) \tan (c+d x)\right )}{(a+i a \tan (c+d x))^2} \, dx}{6 a^2}\\ &=\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {\int \frac {-3 i a^2 B-3 a^2 (2 i A+3 B) \tan (c+d x)}{\sqrt {\tan (c+d x)} (a+i a \tan (c+d x))} \, dx}{24 a^4}\\ &=\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {\int \frac {-3 a^3 A-3 a^3 (i A+2 B) \tan (c+d x)}{\sqrt {\tan (c+d x)}} \, dx}{48 a^6}\\ &=\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {-3 a^3 A-3 a^3 (i A+2 B) x^2}{1+x^4} \, dx,x,\sqrt {\tan (c+d x)}\right )}{24 a^6 d}\\ &=\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {((-1+i) A+2 B) \text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {\tan (c+d x)}\right )}{16 a^3 d}-\frac {((1+i) A+2 B) \text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {\tan (c+d x)}\right )}{16 a^3 d}\\ &=\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {((-1+i) A+2 B) \text {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{32 \sqrt {2} a^3 d}-\frac {((-1+i) A+2 B) \text {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{32 \sqrt {2} a^3 d}-\frac {((1+i) A+2 B) \text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{32 a^3 d}-\frac {((1+i) A+2 B) \text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{32 a^3 d}\\ &=-\frac {((-1+i) A+2 B) \log \left (1-\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{32 \sqrt {2} a^3 d}+\frac {((-1+i) A+2 B) \log \left (1+\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{32 \sqrt {2} a^3 d}+\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {((1+i) A+2 B) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}+\frac {((1+i) A+2 B) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}\\ &=\frac {((1+i) A+2 B) \tan ^{-1}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}-\frac {((1+i) A+2 B) \tan ^{-1}\left (1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{16 \sqrt {2} a^3 d}-\frac {((-1+i) A+2 B) \log \left (1-\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{32 \sqrt {2} a^3 d}+\frac {((-1+i) A+2 B) \log \left (1+\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{32 \sqrt {2} a^3 d}+\frac {(i A-B) \tan ^{\frac {3}{2}}(c+d x)}{6 d (a+i a \tan (c+d x))^3}+\frac {i B \sqrt {\tan (c+d x)}}{4 a d (a+i a \tan (c+d x))^2}+\frac {(A-2 i B) \sqrt {\tan (c+d x)}}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.15, size = 274, normalized size = 0.89 \begin {gather*} \frac {e^{-4 i (c+d x)} \left (\left (1-2 e^{2 i (c+d x)}-e^{4 i (c+d x)}+2 e^{6 i (c+d x)}\right ) \left (B-B e^{2 i (c+d x)}-i A \left (1+2 e^{2 i (c+d x)}\right )\right )-3 B e^{6 i (c+d x)} \sqrt {-1+e^{4 i (c+d x)}} \text {ArcTan}\left (\sqrt {-1+e^{4 i (c+d x)}}\right )+6 (i A+B) e^{6 i (c+d x)} \sqrt {-1+e^{2 i (c+d x)}} \sqrt {1+e^{2 i (c+d x)}} \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right )\right ) \csc (c+d x) (\cos (3 (c+d x))-i \sin (3 (c+d x))) \sqrt {\tan (c+d x)}}{96 a^3 d} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 152, normalized size = 0.49
method | result | size |
derivativedivides | \(\frac {\frac {-i \left (-2 i B +A \right ) \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )+\left (-\frac {10 A}{3}+\frac {2 i B}{3}\right ) \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )+i A \left (\sqrt {\tan }\left (d x +c \right )\right )}{8 \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {B \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}-i \sqrt {2}}\right )}{4 \left (\sqrt {2}-i \sqrt {2}\right )}+\frac {4 \left (-\frac {i A}{16}-\frac {B}{16}\right ) \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}+i \sqrt {2}}\right )}{\sqrt {2}+i \sqrt {2}}}{d \,a^{3}}\) | \(152\) |
default | \(\frac {\frac {-i \left (-2 i B +A \right ) \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )+\left (-\frac {10 A}{3}+\frac {2 i B}{3}\right ) \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )+i A \left (\sqrt {\tan }\left (d x +c \right )\right )}{8 \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {B \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}-i \sqrt {2}}\right )}{4 \left (\sqrt {2}-i \sqrt {2}\right )}+\frac {4 \left (-\frac {i A}{16}-\frac {B}{16}\right ) \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}+i \sqrt {2}}\right )}{\sqrt {2}+i \sqrt {2}}}{d \,a^{3}}\) | \(152\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 635 vs. \(2 (242) = 484\).
time = 0.64, size = 635, normalized size = 2.06 \begin {gather*} \frac {{\left (3 \, a^{3} d \sqrt {\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {2 \, {\left ({\left (i \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a^{6} d^{2}}} - {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) - 3 \, a^{3} d \sqrt {\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{3} d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a^{6} d^{2}}} - {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) + 24 \, a^{3} d \sqrt {-\frac {i \, B^{2}}{64 \, a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (\frac {{\left (8 \, {\left (a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3} d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {i \, B^{2}}{64 \, a^{6} d^{2}}} + B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{3} d}\right ) - 24 \, a^{3} d \sqrt {-\frac {i \, B^{2}}{64 \, a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {{\left (8 \, {\left (a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3} d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {i \, B^{2}}{64 \, a^{6} d^{2}}} - B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{3} d}\right ) + 2 \, {\left (2 \, {\left (2 \, A - i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (4 \, A + i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - {\left (A - 2 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - A - i \, B\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{96 \, a^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.86, size = 131, normalized size = 0.42 \begin {gather*} -\frac {\left (i + 1\right ) \, \sqrt {2} B \arctan \left (\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right )}{16 \, a^{3} d} + \frac {\left (i - 1\right ) \, \sqrt {2} {\left (i \, A + B\right )} \arctan \left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right )}{16 \, a^{3} d} - \frac {3 i \, A \tan \left (d x + c\right )^{\frac {5}{2}} + 6 \, B \tan \left (d x + c\right )^{\frac {5}{2}} + 10 \, A \tan \left (d x + c\right )^{\frac {3}{2}} - 2 i \, B \tan \left (d x + c\right )^{\frac {3}{2}} - 3 i \, A \sqrt {\tan \left (d x + c\right )}}{24 \, a^{3} d {\left (\tan \left (d x + c\right ) - i\right )}^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.69, size = 239, normalized size = 0.77 \begin {gather*} \frac {\frac {A\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{8\,a^3\,d}-\frac {A\,{\mathrm {tan}\left (c+d\,x\right )}^{5/2}}{8\,a^3\,d}+\frac {A\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}\,5{}\mathrm {i}}{12\,a^3\,d}}{-{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,3{}\mathrm {i}+1}+\frac {\frac {B\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}}{12\,a^3\,d}+\frac {B\,{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,1{}\mathrm {i}}{4\,a^3\,d}}{-{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,3{}\mathrm {i}+1}-\frac {{\left (-1\right )}^{1/4}\,B\,\mathrm {atan}\left ({\left (-1\right )}^{1/4}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{8\,a^3\,d}+\frac {{\left (-1\right )}^{1/4}\,B\,\mathrm {atanh}\left ({\left (-1\right )}^{1/4}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{8\,a^3\,d}-\frac {\sqrt {-\frac {1}{256}{}\mathrm {i}}\,A\,\mathrm {atan}\left (16\,\sqrt {-\frac {1}{256}{}\mathrm {i}}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )\,2{}\mathrm {i}}{a^3\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________